import axios from "axios";
axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";

class Request {
  static request: any = axios.create({
    baseURL: import.meta.env.VITE_APP_BASE_URL,
    timeout: 10000,
  });
  static requestInterceptors() {
    this.request.interceptors.request.use((config: any) => {
      return config.data;
    });
  }
  static responseInterceptors() {
    this.request.interceptors.response.use(
      (res: any) => {
        return res.data;
      },
      (err: any) => {
        let message = "";
        let status = err.response.status;
      }
    );
  }
}
Request.requestInterceptors();
Request.responseInterceptors();
export default Request.request;
